package com.gxa.employment.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxa.employment.entity.dto.PageBean;
import com.gxa.employment.entity.pojo.Enterprise;
import com.gxa.employment.entity.pojo.JobEnterprise;
import com.gxa.employment.mapper.JobEenterpriseMapper;
import com.gxa.employment.service.JobEenterpriseService;
import org.springframework.stereotype.Service;

@Service
public class JobEenterpriseServiceimpl extends ServiceImpl<JobEenterpriseMapper,JobEnterprise>implements JobEenterpriseService {

    @Override
    public Page<JobEnterprise> getjobPage(PageBean pageBean) {
        Page<JobEnterprise> page = new Page<>(pageBean.getPage(), pageBean.getSize());
        // 创建 QueryWrapper 对象
        QueryWrapper<JobEnterprise> queryWrapper = new QueryWrapper<>();
        // 设置按 id 字段倒序排列，这里假设实体类中有 id 字段，你可根据实际情况修改为其他字段，如 createTime 等
        queryWrapper.orderByDesc("job_id");
        return baseMapper.selectPage(page, queryWrapper);
    }
}
